class Student {
    private int sno;
    private String sname;
    private String sgender;
    private int sage;
    // 定义成员变量

    public int getno() {
        return sno;
    }

    public String getname() {
        return sname;
    }

    public String getgender() {
        return sgender;
    }

    public int getage() {
        return sage;
    }

    // 获取学号，姓名，性别，年龄的方法
    public void setage(int newage) {
        sage = newage;
    }

    // 修改年龄的方法
    public Student(int no, String name, String gender, int age) {

        sno = no;
        sname = name;
        sgender = gender;
        sage = age;
        // 初始化成员变量
    }
}

public class homework_4 {
    public static void main(String args[]) {
        Student student = new Student(1, "terrace", "男", 20);
        // 创建student类的对象
        System.out.println("学号：" + student.getno());
        System.out.println("姓名：" + student.getname());
        System.out.println("性别：" + student.getgender());
        System.out.println("年龄：" + student.getage());
        // 测试方法功能
        student.setage(18);
        // 修改年龄并再次输出
        System.out.println("修改后的年龄：" + student.getage());
    }
}